import pprint


if __name__ == '__main__':
    f = open(r"somefile.txt")
    # t = f.read(7)
    # print(t)
    # fore = f.read(4)
    # print(fore)

    # print(f.read())

    # for i in range(3):
    #     print(str(i) + ":" + f.readline(), end='')
    # pprint.pprint(open('somefile.txt').readlines())
    f = open("somefile.txt")
    # print(f.write('this\nis no\nhaiku'))
    lines = f.readlines()
    f.close()
    lines[1] = "isn't a\n"
    f = open("somefile.txt",'w')
    f.writelines(lines)


    f.close()
